package com.systop.asset.exception;

import com.systop.asset.enums.HttpCodeEnum;
import lombok.Data;

@Data
public class SystemException extends RuntimeException{

    private final int code;
    private final String message;

    public SystemException(HttpCodeEnum httpCodeEnum) {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.message = httpCodeEnum.getMsg();
    }

    public SystemException(HttpCodeEnum httpCodeEnum, String message) {
        super(message);
        this.code = httpCodeEnum.getCode();
        this.message = message;
    }

    public SystemException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
